var html = document.querySelector('html');
rem();
window.addEventListener('resize',function () {
    rem();
});
function rem() {
    var width = html.getBoundingClientRect().width;
    html.style.fontSize = width/10+ 'px';
}